<template>
  <div>
    <el-table :cell-style="{padding:this.tablePadding}" v-loading="loading" :data="tableData" style="width: 100%">
    <el-table-column prop="paramName" label="参数名称"> </el-table-column>
    <el-table-column prop="paramCategoryName" label="参数类型"> </el-table-column>
    <el-table-column prop="valueNumber" label="参数值"> </el-table-column>
    <el-table-column prop="unitName" label="计量单位"> </el-table-column>
    <el-table-column prop="remark" label="备注"> </el-table-column>
  </el-table>
  <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { getMaterialInfo } from "@/api/base/material";
export default {
  data() {
    return {
      tableData: [],
      total: 0,
      loading: false,
      queryParams:{
        materialId:null,
        pageNum:1,
        pageSize:10
      }
    };
  },
  methods: {
    setNull(){
     this.tableData=[]
     this.total=0
     this.queryParams={
       materialId:null,
        pageNum:1,
        pageSize:10
     }
   },
    getList(){
      getMaterialInfo(this.queryParams).then((response) => {
        this.tableData = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getInfo(id) {
      this.queryParams.materialId=id
      this.getList()
    },
  },
};
</script>

<style lang="sass" scoped>
</style>>
